package com.bw.purchase.mapper;

import com.bw.pojo.PmsSku;
import com.bw.purchase.pojo.Do.PurchaseDo;
import com.bw.purchase.pojo.Dto.PurchaseDto;
import com.bw.purchase.pojo.Vo.PurchaseVo;
import com.bw.purchase.pojo.Vo.SkuPurchaseVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PurchaseMapper {

    /**
     * 修改库存数量
     * @param skuId
     * @param purchaseNum
     */
    void updatePurchaseNum(@Param("skuId") Integer skuId, @Param("purchaseNum") Integer purchaseNum);

    /**
     * 添加订单记录
     * @param purchaseDo
     */
    void addPurchaseList(PurchaseDo purchaseDo);


    /**
     * 添加商品订单中间表
     * @param id
     * @param skuId
     * @param purchaseNum
     */
    void addSkuPurchase(@Param("id") Integer id, @Param("skuId") Integer skuId, @Param("purchaseNum") Integer purchaseNum,@Param("status") Integer status);

    /**
     * 采购单审核
     * @param id
     */
    void updatePurchaseStatus(Integer id);

    /**
     * 查询审核订单列表
     * @param purchaseDto
     * @return
     */
    List<PurchaseVo> selectPurchaseList(PurchaseDto purchaseDto);

    /**
     * 预警商品列表展示
     * @param shopId
     * @return
     */
    List<PmsSku> pmsSkuList(Long shopId);

    /**
     * 查询审核表信息
     * @param id
     * @return
     */
    List<SkuPurchaseVo> selectSkuPurchase(Integer id);

    /**
     * 删除中间表
     * @param id
     */
    void deleteSkuPurchase(Integer id);
}
